package cn.waitsunshine.springframework;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @description: bean管理工厂
 * @Author: kai
 * @Date: 2025-01-30
 */
public class BeanFactory {

	private Map<String,BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>();

	public Object getBean(String name){
		return beanDefinitionMap.get(name).getBean();
	}

	public void registerBeanDefinition(String name,BeanDefinition beanDefinition){
		beanDefinitionMap.put(name,beanDefinition);
	}

}
